﻿@model Utilities.ViewModel.PagedList<Home.Domain.Entities.Example.UserInfo>
@using Utilities.ViewModel.HtmlHelpers
@{
    ViewBag.Title = "";
    Layout = "~/Areas/Example/Views/Shared/_Layout.cshtml";
}
@section head{
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("[name='Delete']").click(
    function () {
        if (confirm("确定要删除\"" + $(this).attr("tip") + "\"吗？")) {
            var stuid = $(this).attr("stuid");
            var tr = $(this).parent().parent();
            $.post("@Url.Action("Delete")", { id: stuid }, function (data) {
                 if (data == "-1") { alert("删除失败"); }
                 if (data > 0) {
                     alert("此分类中有" + data + "项");
                 }
                 else {
                     $(tr).remove(); alert("删除成功");
                 }
             });
         }
    });
    });
</script>
}
<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="coupons">
	@{Html.RenderPartial("_Manager");}
    <div id="content" class="coupons-box clear mainwide">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
            <div class="head">
				                    <h2>@(ViewBag.ColumnTitle)列表</h2>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr>
                        <th width="150">ID</th>
                        <th width="500">用户名</th>
                        <th width="200">操作</th>
                    </tr>
                     @{int beijing = 1;
                       foreach (var item in Model.Entities)
                       {
                           beijing++;
				    <tr @(beijing % 2 == 1 ? null : Html.Raw(@"class=""alt""")) id="team-list-id-244">
						
						<td>@item.Id</td>
						<td>@item.UserName</td>
						<td>
                        @Html.ActionLink("编辑","Edit",new{id=item.Id})|<a href="javascript:void(0)" name="Delete" tip="@item.UserName" stuid="@item.Id">删除</a>
                        </td>
					</tr>
                       }
                       }
<tr><td colspan="4"><ul class="paginator">@Html.PageLinks(Model.PagingInfo, x => Url.Action("Index", new { Page = x }))</ul></td></tr>
					</table>
				</div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
</div>
</div> <!-- bd end -->
</div>
